package de.baumann.browser.views.dialog

import android.content.Context

class CreateOrImportDialog(context: Context) : BaseTipDialogs(context) {
    var selectListener: SelectListener? = null
    fun setSelectListener(listener: (Int) -> Unit): CreateOrImportDialog {
        this.selectListener = object : SelectListener {
            override fun selected(type: Int) {
                listener(type)
            }
        }
        return this
    }

    override fun initView() {
        setCanceledOnTouchOutside(false)
        setCancelable(false)
        super.initView()
        getCreateButton().setOnClickListener {
            dismiss()
            selectListener?.selected(1)

        }
        getButton().setOnClickListener {
            dismiss()
            selectListener?.selected(0)
        }


    }

    override fun getTipContent(): String {
        return "请先创建或导入钱包"
    }

    override fun getTipSubContent(): String {
        return "创建"
    }

    override fun getTipButtonText(): String {
        return "导入"
    }

    interface SelectListener {
        fun selected(type: Int)
    }


}